package com.ruoyi.web.wx.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.notice.domain.Notice;
import com.ruoyi.notice.service.INoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "通知")
@RestController
@RequestMapping("/wx/ddnotice")
public class WxNoticeController {

    @Autowired
    private INoticeService noticeService;

    /**
     * 查询【公告】列表
     */
    @ApiOperation("查询所有通知公告")
    @GetMapping("/list")
    public AjaxResult list(Notice notice) {
        return AjaxResult.success(noticeService.selectNoticeList(notice));
    }

    @ApiOperation("查询通知公告详情")
    @GetMapping("getNoticeById/{id}")
    public AjaxResult getNoticeById(@PathVariable Long id) {
        return AjaxResult.success(noticeService.selectNoticeById(id));
    }
}
